{include file="common/head"}
<head>
  <style type="text/css">
      html{height: 100%;}
      #top{background: initial;border-bottom:1px solid rgba(0,0,0,0.1);}
      #top *{color: white;}
      .mb-3{margin-bottom:0!important;}
  </style>    
</head>
<body style="background-image: linear-gradient(to bottom right,{$color[0]},{$color[1]});max-width: 800px;">
  <div id="header"></div>
  <div id="top" class="row text-center" style="height: 50px;line-height: 50px;">
    <div class="col-2 text-center">
      <a href="/index.php/customer/aboutme"><span class="bi-chevron-left"></span></a>      
    </div>
    <div class="col-8 text-center">修改资料</div>
    <div class="col-2 text"></div>
  </div>

    <div class="container p-5 my-5 d-grid" style="padding: 10px;" >
      <input type="hidden" name="id" id="id" value="{$data.id}" />

      <div class="mb-3 ">
        <label for="title" class="form-label">姓名(Name):</label>
        <input type="text" class="form-control" id="name" name="name" value="{$data.name}" disabled  />
      </div>

      <div class="mb-3 ">
        <lable for="name" class="form-label">手机号(Mobile):</label>
        <input type="text" class="form-control" id="mobile" name="mobile" value="{$data.mobile}" disabled />
      </div>

      <div class="mb-3 ">
        <label for="title" class="form-label">地址(Address):</label>
        <input type="text" class="form-control" id="address" name="address" value="{$data.address}"  />
      </div>

      <div class="mb-3 ">
        <label for="password" class="form-label">修改密码:(Password):</label>
        <input type="text" class="form-control" id="password" name="password" value=""  />
      </div>

      <div style="height: 10px;"></div>

      <div class="mb-3 ">
          <button type="button" class="form-control btn btn-info" id="save">保存(Save)</button>
      </div>    
      <div style="height: 20px;"></div>

   

    </div>

<script type="text/javascript">
$(document).ready(function(){

  
  $("#save").on('click',function(){
      var id=$("#id").val();
      var password = $("#password").val();
      var address = $("#address").val();

      if(!password && !address) {
        layer.msg("what?");
        return false;
      }

      //询问框
      layer.confirm('Are you sure?', {btn: ['Yes','No'],title:'Confirm' }, function(){
        $('form').submit();

        $.ajax({
          url:'/index.php/customer/aboutme',
          data:{'id':id,'password':password,address:address},
          success:function(res){
            //var res = JSON.parse(res);
            console.log(res.msg);
            layer.msg(res.msg);

          }
        })
      }, function(){
        layer.msg("Cancel!");
        return 0;
      });

  })

})


</script>


</body>
</html>

